<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{layout/base}">
<head>
    <title>系统仪表板</title>
</head>
<body>
<div layout:fragment="content">
    <!-- 页面标题 -->
    <div class="d-flex justify-content-between align-items-center mb-4">
        <h1 class="h3 mb-0">仪表板</h1>
        <div class="btn-group">
            <button class="btn btn-outline-secondary">
                <i class="fas fa-sync-alt"></i> 刷新
            </button>
        </div>
    </div>

    <!-- 统计卡片 -->
    <div class="row">
        <div class="col-md-3 mb-4">
            <div class="card bg-primary text-white">
                <div class="card-body">
                    <div class="d-flex justify-content-between">
                        <div>
                            <h4 class="card-title">1,234</h4>
                            <p class="card-text">总用户数</p>
                        </div>
                        <div class="align-self-center">
                            <i class="fas fa-users fa-2x"></i>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-3 mb-4">
            <div class="card bg-success text-white">
                <div class="card-body">
                    <div class="d-flex justify-content-between">
                        <div>
                            <h4 class="card-title">567</h4>
                            <p class="card-text">活跃用户</p>
                        </div>
                        <div class="align-self-center">
                            <i class="fas fa-user-check fa-2x"></i>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-3 mb-4">
            <div class="card bg-warning text-white">
                <div class="card-body">
                    <div class="d-flex justify-content-between">
                        <div>
                            <h4 class="card-title">89</h4>
                            <p class="card-text">新注册</p>
                        </div>
                        <div class="align-self-center">
                            <i class="fas fa-user-plus fa-2x"></i>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-3 mb-4">
            <div class="card bg-info text-white">
                <div class="card-body">
                    <div class="d-flex justify-content-between">
                        <div>
                            <h4 class="card-title">45.6%</h4>
                            <p class="card-text">转化率</p>
                        </div>
                        <div class="align-self-center">
                            <i class="fas fa-chart-line fa-2x"></i>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 最近活动 -->
    <div class="row">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header">
                    <h5 class="card-title mb-0">最近活动</h5>
                </div>
                <div class="card-body">
                    <div class="table-responsive">
                        <table class="table table-hover">
                            <thead>
                            <tr>
                                <th>用户</th>
                                <th>操作</th>
                                <th>时间</th>
                                <th>状态</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td>张三</td>
                                <td>登录系统</td>
                                <td>2024-01-15 10:30</td>
                                <td><span class="badge bg-success">成功</span></td>
                            </tr>
                            <tr>
                                <td>李四</td>
                                <td>修改密码</td>
                                <td>2024-01-15 09:15</td>
                                <td><span class="badge bg-success">成功</span></td>
                            </tr>
                            <tr>
                                <td>王五</td>
                                <td>创建用户</td>
                                <td>2024-01-14 16:45</td>
                                <td><span class="badge bg-success">成功</span></td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-md-4">
            <div class="card">
                <div class="card-header">
                    <h5 class="card-title mb-0">系统状态</h5>
                </div>
                <div class="card-body">
                    <div class="mb-3">
                        <strong>CPU 使用率:</strong>
                        <div class="progress mt-1">
                            <div class="progress-bar" role="progressbar" style="width: 65%">65%</div>
                        </div>
                    </div>
                    <div class="mb-3">
                        <strong>内存使用:</strong>
                        <div class="progress mt-1">
                            <div class="progress-bar bg-success" role="progressbar" style="width: 45%">45%</div>
                        </div>
                    </div>
                    <div class="mb-3">
                        <strong>磁盘空间:</strong>
                        <div class="progress mt-1">
                            <div class="progress-bar bg-warning" role="progressbar" style="width: 78%">78%</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div layout:fragment="scripts">
    <script>
        // 仪表板特定的JS代码
        console.log('仪表板加载完成');
    </script>
</div>
</body>
</html>